export default{
    name:'preview',
    mounted(el,binding, vnode){
        el.addEventListener('click',(e)=>{
            let src = el.src;
            
            if (src==undefined && el.attributes['image']!=undefined){
                  src = el.attributes['image'].nodeValue;
            }
           
            if (src!=undefined && src!=''){
                var dom = document.createElement('div');
                dom.className = 'preview-container-box';

                var _img = document.createElement('img');
                _img.className = "preview-image";
                _img.src = src;
                
                dom.addEventListener('click',()=>{
                    dom.remove();
                });

                dom.appendChild(_img);
               // admin.appendBody(dom);
               document.body.appendChild(dom);
            }
        });

    }
}